package com.graducationdesign.springboot.controller.Teacher;

import com.graducationdesign.springboot.entities.Administrator.GraducationDesignListMoudle.GraducationDesign;
import com.graducationdesign.springboot.entities.Administrator.PersonnalInformationMoudle.Teacher;
import com.graducationdesign.springboot.entities.Student.GraducationDesign.AllGraducationDesign;
import com.graducationdesign.springboot.mapper.AllGraducationDesignMapper;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;
import java.util.Map;

/**
 * @author Mr.zhneg
 * @create 2020-02-02-22:54
 */
@Controller
public class AllGraductionDesignListForTeaController {

    org.slf4j.Logger logger=  LoggerFactory.getLogger(getClass());

    @Autowired
    AllGraducationDesignMapper allGraducationDesignMapper;

    @GetMapping("/alldesignsfortea")
    public String list(Map<String,Object> map,AllGraducationDesign graducationDesign){

        logger.info("毕业设计查询："+graducationDesign);

        List<AllGraducationDesign> graducationDesigns= allGraducationDesignMapper.getGraducationDesigns(graducationDesign);

        map.put("teachername",graducationDesigns);
        map.put("name",graducationDesign.getDesignname());


        return "Teacher/graduationDesignMoudle/allgraductiondesignlist";
    }

    @GetMapping("/viewgraductiondesignsfortea/{id}")
    public String view(Map<String,Object> map, @PathVariable("id") Integer id){

        logger.info("查看毕业设计：");
        AllGraducationDesign allGraducationDesigns=allGraducationDesignMapper.viewGraducationDesignfortea(id);
        map.put("allGraducationDesignsforteacher",allGraducationDesigns);

        return "Teacher/graduationDesignMoudle/graductiondesignview";
    }


}
